<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let arr = [{
        id: 1,
        name: 'jack',
        num: 50
    }, {
        id: 2,
        name: 'jack2',
        num: 60
    }, {
        id: 3,
        name: 'jack3',
        num: 40
    }, {
        id: 4,
        name: 'jack4',
        num: 80
    }, {
        id: 5,
        name: 'jack5',
        num: 30
    }]



    for(let  i = 0,len = arr.length;i<len;i++){
        for(let j = 1;j<arr.length-1;j++){
            if(arr[i].num > arr[j].num){
                let obj = JSON.parse(JSON.stringify(arr[i]))
                arr[i] = JSON.parse(JSON.stringify(arr[j]))
                arr[j] = JSON.parse(JSON.stringify(obj))
            }
        }
    }

    console.log(arr)



   const arr2 = arr.slice(0,10)
    console.log(arr2)
</script>
</body>
</html>
